import 'package:flutter/material.dart';
import '../../routers/application.dart';
import '../../icons/IVCIcons.dart';
import 'package:ivc/globals.dart' as globals;

class DemoChangeRolePage extends StatefulWidget {
  @override
  DemoChangeRolePageState createState() => new DemoChangeRolePageState();
}

class DemoChangeRolePageState extends State<DemoChangeRolePage> {
  final TextStyle textStyle =
      TextStyle(fontSize: 16, fontWeight: FontWeight.w300);
  bool hasLogin;

  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    //super.build(context);
    return Scaffold(
        appBar: AppBar(title: Text('测试用户角色切换')),
        body: ListView(
          padding: EdgeInsets.zero,
          children: <Widget>[
            new Divider(),
            ListTile(
              leading: Icon(
                Icons.account_balance,
                size: 27.0,
              ),
              title: Text(
                '测试角色切换',
                style: textStyle,
              ),
              onTap: () {
                Application.router.navigateTo(context, "/demo_change_role");
              },
            ),
            new Divider(),
            ListTile(
              leading: Icon(
                Icons.account_balance,
                size: 27.0,
              ),
              title: Text(
                '向平台下订单',
                style: textStyle,
              ),
              onTap: () {
                Application.router.navigateTo(context, "/placeorder");
              },
            ),
            new Divider(),
            ListTile(
              leading: Icon(
                Icons.account_balance,
                size: 27.0,
              ),
              title: Text(
                '产业链运营',
                style: textStyle,
              ),
              onTap: () {
                globals.userRole = "operator_gov";
                Application.router.navigateTo(context, "/home");
              },
            ),
            new Divider(),
            ListTile(
              leading: Icon(
                Icons.account_balance,
                size: 27.0,
              ),
              title: Text(
                '切换场景-注塑机',
                style: textStyle,
              ),
              onTap: () {
                globals.scenarioKey = "zhusu";
                Application.router.navigateTo(context, "/home");
              },
            ),
            new Divider(),
            ListTile(
              leading: Icon(
                Icons.account_balance,
                size: 27.0,
              ),
              title: Text(
                '切换场景-工程机械租赁',
                style: textStyle,
              ),
              onTap: () {
                globals.scenarioKey = "gcjx_zl";
                Application.router.navigateTo(context, "/home");
              },
            ),
            new Divider(),
            SizedBox(height: 300),
          ],
        ));
  }
}
